home *** CD-ROM | disk | FTP | other *** search
- #include <iostream>
- #include "VCPPExample.h"
-
- enum {NSRecallNetwork, NSLearningNetwork};
-
- int main()
- {
- HINSTANCE hDLL = LoadDLLFunctions("C:\\Program Files\\NeuroSolutions 4\\Wizards\\CustomSolutionWizard\\Examples\\DLL\\MLP.dll");
- if (hDLL)
- {
- float *inputData = new float[8];
- inputData[0] = -1;
- inputData[1] = -1;
- inputData[2] = -1;
- inputData[3] = 1;
- inputData[4] = 1;
- inputData[5] = -1;
- inputData[6] = 1;
- inputData[7] = 1;
-
- float *desiredData = new float[4];
- desiredData[0] = -1;
- desiredData[1] = 1;
- desiredData[2] = 1;
- desiredData[3] = -1;
-
- void *nn;
- createNetwork(nn, NSLearningNetwork);
-
- loadWeights(nn,"C:\\Program Files\\NeuroSolutions 4\\Wizards\\CustomSolutionWizard\\Examples\\DLL\\MLP.nsw");
-
- std::cout << "Epochs: ";
- int epochs;
- std::cin >> epochs;
-
- train(nn, epochs, 4, inputData, desiredData, 0, NULL, NULL);
-
- float *outputData = new float[4];
- getResponse(nn, 4, inputData, outputData);
-
- std::cout << "\nNetwork Output\n";
- for (int i = 0; i < 4; i++)
- std::cout << outputData[i] << "\n";
-
- delete inputData;
- delete desiredData;
- destroyNetwork(nn);
- FreeLibrary(hDLL);
- }
- else
- std::cout << "ERROR LOADING DLL";
-
- std::cout << "\n\nType any character then click Enter to exit!\n";
- char aChar;
- std::cin >> aChar;
-
- return 0;
- }